using System;
using System.Web.Configuration;
using System.Web.Security;

public partial class admin_Login : System.Web.UI.Page
{
	DBControl conDB = new DBControl(WebConfigurationManager.ConnectionStrings["TestBase"].ConnectionString);

    protected void Page_Load(object sender, EventArgs e)
    {
		if( Request.Params["mode"] == "logout")
			FormsAuthentication.SignOut();
    }

	protected void LogonUser(object sender, EventArgs e)
	{
		if (conDB.AuthUser(UserName.Text, Password.Text))
			FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
		else
			Error.Visible = true;
	}
}
